package lgs.hm.controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import lgs.hm.mapper.DeptMapper;
import lgs.hm.model.Dept;

@Controller
@RequestMapping("dept")
public class DeptController {
	@Resource
	private DeptMapper deptMapper;
	
	@GetMapping("deptid")
	@ResponseBody
	public Object finddeptID(Integer deptId) {
		return deptMapper.findById(deptId);
	}
	
	@GetMapping("allDept")
	@ResponseBody
	public Object allDept(Map<String, Object> map) {
		List<Dept> dept = deptMapper.allDept();
		map.put("deptlist", dept);
		return dept;
	}

	
	

}
